package com.verlet.stringsplit.spring.boot.service;


import org.springframework.lang.NonNull;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.util.Objects;

/**
 * 业务处理
 *
 * @author verlet
 */
public class StringsplitService {

    private final String config;

    public StringsplitService(String config) {
        this.config = config;
    }

    public String[] split(@NonNull String separatorChar) {
        if(ObjectUtils.isEmpty(config.strip())){
            return new String[0];
        }
        return this.config.split(separatorChar);
    }
}
